package com.program.wechatmall.bean;

import lombok.Data;

/**
 * 该文件不要修改
 * @param <T>
 */
@Data
public class BaseResponseVo<T> {
    T data;
    String msg;
    long errno;//和前端约定好就可以了

    public static BaseResponseVo ok(Object data){
        BaseResponseVo baseResponseVo = BaseResponseVo.ok();
        baseResponseVo.setData(data);
        return baseResponseVo;
    }
    public static BaseResponseVo ok(){
        BaseResponseVo baseResponseVo = new BaseResponseVo();
        baseResponseVo.setMsg("成功");
        baseResponseVo.setErrno(0);
        return baseResponseVo;
    }
    public static BaseResponseVo fail(){
        BaseResponseVo baseResponseVo = new BaseResponseVo();
        baseResponseVo.setMsg("失败");
        baseResponseVo.setErrno(500);
        return baseResponseVo;
    }
}
